package cn.schoolwow.quickdao.module.operation.flow.generateEntity;

import cn.schoolwow.quickdao.domain.operation.GenerateJavaSourceFileRequest;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import org.apache.commons.lang3.Validate;

public class CheckGenerateEntityFileRequestFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        GenerateJavaSourceFileRequest generateJavaSourceFileRequest = (GenerateJavaSourceFileRequest) flowContext.checkData("generateJavaSourceFileRequest");

        Validate.notEmpty(generateJavaSourceFileRequest.javaSourceClassPath, "请指定java源文件夹路径");
        Validate.notEmpty(generateJavaSourceFileRequest.packageName, "请指定生成实体类的包名");
    }

    @Override
    public String name() {
        return "检查生成实体类文件请求";
    }
}
